package com.ea.common.report;

import com.ea.common.auth.FeignConfig;
import com.ea.common.report.pojo.param.*;
import com.ea.common.report.pojo.vo.*;
import com.ea.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.Date;
import java.util.List;

@FeignClient(
        name = "ea-report",
        url = "${lb.url}/ea-report",
        configuration = FeignConfig.class
)
public interface ReportFeign {
    @PostMapping("/report/getUserReportVoByUserId")
    Result<UserDetailVo> getUserReportVoByUserId(
            @RequestBody @Valid GetUserReportVoParam getUserReportVoParam
    );

    /**
     * 使用前需要检查用户是否存在，并将companyId一起传入
     */
    @PostMapping("/report/uploadVideo")
    Result<Long> uploadVideo(
            @RequestParam("md5") String md5,
            @RequestParam("userId") String userId,
            @RequestParam("companyId") String companyId,
            @RequestParam("type") Integer type
    );

    @PostMapping("/report/uploadPhoto")
    Result uploadPhoto(
            @RequestParam("md5") String md5,
            @RequestParam("userId") String userId,
            @RequestParam("name") String name
    );

    @PostMapping("/report/uploadPhotoTemp")
    Result  uploadPhotoTemp(
            @RequestParam("md5") String md5,
            @RequestParam("userId") String userId,
            @RequestParam("name") String name
    );

    @PostMapping("/report/getReportSimpleInfoVoListByUserId")
    Result<ReportSimpleInfoListVo> getReportSimpleInfoVoListByUserId(
            @RequestBody @Valid GetReportSimpleInfoVoListParam getReportSimpleInfoVoListParam
    );

    //TODO
    @PostMapping("/report/getReportList")
    Result<ReportSimpleInfoListVo> getReportList(
            @RequestBody @Valid GetReportListParam getReportListParam
            );

    @PostMapping("/report/getReportListNew")
    Result<ReportSimpleInfoListVo> getReportListNew(
            @RequestBody @Valid GetReportListNewParam getReportListNewParam
    );


    @PostMapping("/report/getReportDetail")
    Result<ReportDetailInfoVo> getReportDetail(
            @RequestParam("reportId") String reportId
    );

//    @PostMapping("/report/getReportInfo")
//    Result<ReportDetailInfoVo> getReportInfo(
//            @RequestParam("userId") String userId,
//            @RequestParam("md5") String md5
//    );
    @PostMapping("/report/getCompanyIdByReportId")
    Result<String> getCompanyIdByReportId(
            @RequestParam("reportId") String reportId
    );

    @PostMapping("/report/getWarningInfoVo")
    Result<GetWarningInfoVo> getWarningInfoVo(
            @RequestBody GetWarningInfoLongParam getWarningInfoLongParam
    );

    //TODO
    @PostMapping("/report/getStatsReport")
    Result<StatsReportVo> getStatsReport(
            @RequestBody @Valid GetStatsReportVoParam getStatsReportParam
    );

    //TODO
    @PostMapping("/report/getDashboardVo")
    Result<DashboardVo> getDashboardVo(
            @RequestBody @Valid GetDashboardVoParam getDashboardVoParam
    );

    @PostMapping("/report/getPropertiesList")
    Result<GetPropertiesListVo> getPropertiesList( );

    @PostMapping("/actuator/refresh")
    List<String> refresh();

    @PostMapping("/report/deleteUserFace")
    Result deleteUserFace(@RequestParam("userId") String userId);

    @PostMapping("/report/updateUserInfo")
    Result updateUserInfo(
            @RequestParam("userId") Long userId,
            @RequestParam("companyId") Long companyId
    );

    @GetMapping("/report/super/test/deleteUserFaceDirtyData/{count}")
    Result<String> deleteUserFaceDirtyData(@PathVariable int count);

    @GetMapping("/report/super/test/deleteFaceRegDirtyData/{count}")
    Result<String> deleteFaceRegDirtyData(@PathVariable int count);

    @PostMapping("/actuator/restart")
    void restart();
}
